<template>
  <div class="vote-detail">
      <div class="menu-item">
         <div class="name">投票主题 ：</div>
         <div class="value">{{info.voteTitle}}</div>
      </div>
     <div class="menu-item">
         <div class="name">主题ID：</div>
         <div class="value">{{info.voteId}}</div>
      </div>
      <div class="menu-item">
         <div class="name">投票项：</div>
         <div class="value">{{info.optionContent}}</div>
      </div>
      <div class="menu-item">
         <div class="name">代币名称：</div>
         <div class="value">{{info.voteAssetCode}}</div>
      </div>
      <div class="menu-item">
         <div class="name">选项地址：</div>
         <div class="value">{{info.optionAddress}}</div>
      </div>
     <div class="menu-item">
         <div class="name">投票人：</div>
         <div class="value">{{info.userAddress}}</div>
      </div>
      <div class="menu-item">
         <div class="name">交易哈希：</div>
         <div class="value">{{info.tradingHash}}</div>
      </div>
      <div class="menu-item">
         <div class="name">选项票数：</div>
         <div class="value">{{info.optionTurnout}}票</div>
      </div>
      <div class="menu-item">
         <div class="name">总投票数：</div>
         <div class="value">{{info.voteTurnout}}票</div>
      </div>
     <div class="menu-item ">
         <div class="name">投票占比：</div>
         <div class="value">{{info.proportion}}%</div>
      </div>
      <div class="menu-item">
         <div class="name">交易状态：</div>
         <div class="value">成功</div>
      </div>
      <div class="menu-item">
         <div class="name">交易时间：</div>
         <div class="value">{{info.tradingTime}}</div>
      </div>
  </div>
</template>
<script>
let CONSTANT = require('../../../wechat/static/constant/constant.js'),
    common = require("../../../wechat/static/common/common.js");
  export default {
    data() {
      return {
        info:'',
        id:''
      }
    },
    mounted() {
        this.id = this.$router.currentRoute.query.id;
        let type = this.$router.currentRoute.query.type;
        if(type == 'vote'){
            console.log(this.$router)
            this.$router.currentRoute.meta.title = '投票明细'
        }
        this.getActivity()
    },
    methods: {
      getActivity(){
        let  url = CONSTANT.URL.VOTE.HASHDETAIL,
            param = {tradingHash:this.id}
        common.requestAjax(url,{},param,(res)=>{
            if(res.status == 200){
                this.info = res.data.bussData;
            }else{

            }
        })
      },
      linkTo(link,id){
        this.$router.push({ path: link, query: { id: id }})
      },
    }
  };
</script>
<style lang="scss">
    .vote-detail{
        min-height: 100%;
        background-color: #fff;
        padding-top: .2rem;
        .menu-item{
            font-size: .32rem;
            color: #333;
            padding: 0 .35rem 0 .29rem;
            overflow: auto;
            margin-bottom: .3rem;
            .name{
                font-weight: bold;
                width: 1.92rem;
                text-align: left;
                float: left;
                margin-right: .05rem;
            }
            .value{
                width: 4.87rem;
                padding-top: .05rem;
                word-wrap:break-word;
                float: left;
                font-size: .28rem;
            }
        }
    }
</style>

